package gov.dhs.cis.soa.data;

import gov.dhs.cis.soa.Constants.EntityType;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;


public class Actor extends AbstractSOAData {
	public int id;
	public String name;
	public String roleType;
	
	public List<Actor> childrenList =  null;
	public transient Timestamp createdDt = new Timestamp(System.currentTimeMillis());
	public Description desc;

	@Override
	public String toString() {
//		return "Actor [id=" + id + ", name=" + name + "]";
		String ret = "Actor [id=" + id + ", name=" + name + ", Desc = " + desc + "] ";
		if(childrenList != null) {
			for(Actor a : childrenList) {
				ret += a.toString();
			}
		}
		return ret;
	}
	
	public void addChildActor(Actor aObj) {
		if(aObj == null)
			return;
		if(childrenList == null)
			childrenList = new ArrayList<Actor>();
		childrenList.add(aObj);
	}
	
//	public static String getUMLId(int entityId) {
//		return EntityType.ACTR + "_" + entityId;
//	}

	@Override
	public String getHashableId() {
		return name;
	}

	@Override
	public long getId() {
		return id;
	}

	@Override
	public EntityType getUMLType() {
		return EntityType.ACTR;
	}
}

